<template>
  <div class="radio">
    <van-field name="radio" :label="element.label" :required="element.required" :disabled="element.disabled">
      <template #input>
        <van-radio-group v-model="element.vModel" direction="horizontal" :disabled="element.disabled">
          <van-radio v-for="item in optionsList" :key="item.value" :name="item.value">{{item.label}}</van-radio>
        </van-radio-group>
      </template>
    </van-field>
  </div>
</template>

<script>
export default {
  name: 'radio',
  inject: ['element'],
  data() {
    return {

    }
  },
  computed: {
    optionsList() {
      return this.element.optionsSource === '0' ? this.element.options : this.element?.urlData?.urlOptions
    }
  },
  methods: {
    change(val) {}
  }
}
</script>

<style lang="scss" scoped>
.van-cell::after {
  display: block;
}
</style>